<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>order</title>
    <style>
      .flex-container {
        display: -webkit-flex;
        display: flex;
        width: auto;
        height: 150px;
        background-color: lightgrey;
      }

      .flex-item {
        background-color: cornflowerblue;
        width: 100px;
        height: 100px;
        margin: 10px;
        text-align: center;
      }
    </style>
  </head>

  <body>
    <h1>order 属性设置弹性容器内弹性子元素的顺序。</h1>

    <h2>用整数值来定义排列顺序，数值小的排在前面。可以为负值。</h2>
    <div class="flex-container">
      <div class="flex-item" style="order: 0">flex item 1</div>
      <div class="flex-item" style="order: 1">flex item 2</div>
      <div class="flex-item" style="order: -1">flex item 3</div>
    </div>
    <br />
    <div class="flex-container">
      <div class="flex-item" style="order: -10">flex item 1</div>
      <div class="flex-item" style="order: -20">flex item 2</div>
      <div class="flex-item" style="order: 1">flex item 3</div>
    </div>
  </body>
</html>
